package ochart.core
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Point;
	
	import ochart.chartClasses.IChartObject;
	import ochart.chartClasses.IData;
	import ochart.elements.background.Background;
	import ochart.renders.IRenderer;
	import ochart.renders.Renderer;
	import ochart.renders.RendererFactory;
	import ochart.serialization.ISerialzer;
	import ochart.serialization.SerializationFormat;
	import ochart.serialization.SerializeFactory;
	import ochart.utils.ArrayUtil;
	import ochart.utils.StringUtil;
	import ochart.utils.logging.Logger;
	
	public class ChartObject extends Sprite implements IChartObject, IData
	{
		public static const CLASS_NAME:String = "ChartObject"

		public function get className():String
		{
			return CLASS_NAME;
		}
		
		public static const ALIAS:String = "chartObject";
		
		public function get alias():String
		{
			return ALIAS;
		}
		
		public static const LEFT:String = "left";
		public static const CENTER:String = "center";
		public static const RIGHT:String = "right";
		public static const TOP:String = "top";
		public static const MIDDLE:String = "middle";
		public static const BOTTOM:String = "bottom";
		
		private static var logger:Logger = Logger.getLogger(CLASS_NAME);
		
		public var serializeComplete:Boolean = false;
		public var renderComplete:Boolean = false;
		public var createComplete:Boolean = false;
		
		private var _data:Object = null;
		
		public function get data():Object
		{
			return _data;
		}
		
		public function set data(value:Object):void
		{
			_data = value;
			
			serializeComplete = fromData(this.data);
		}
		
		private var _dataFormat:String = null;
		
		public function get dataFormat():String
		{
			return _dataFormat;
		}
		
		public function set dataFormat(value:String):void
		{
			_dataFormat = value;
		}
		
		private var _serializer:ISerialzer = null;
		
		public function get serializer():ISerialzer
		{
			return _serializer;
		}
		
		public function set serializer(value:ISerialzer):void
		{
			_serializer = value;
		}
		
		public function get serializerFormat():String
		{
			if(this.serializer)
			{
				return this.serializer.format;
			}
			return null;
		}
		
		private var _needRender:Boolean = false;

		public function get needRender():Boolean
		{
			return _needRender;
		}

		public function set needRender(value:Boolean):void
		{
			_needRender = value;
			
			if(_needRender)
			{
				needUpdate = true;
			}
		}

		private var _renderer:IRenderer = null;
		
		public function get renderer():IRenderer
		{
			return _renderer;
		}
		
		public function set renderer(value:IRenderer):void
		{
			_renderer = value;
		}
		
		public function get rendererType():String
		{
			if(this.renderer)
			{
				return this.renderer.type;
			}
			return null;
		}
		
		private var _chart:ChartBase = null;

		public function get chart():ChartBase
		{
			if(_chart)
			{
				return _chart;
			}
			var target:Object = this;
			while(target)
			{
				if(target is ChartBase)
				{
					_chart = target as ChartBase;
					break;
				}
				target = target.parent;
			}
			return _chart;
		}

		public function set chart(value:ChartBase):void
		{
			_chart = value;
		}

		private var _needUpdate:Boolean = false;

		public function get needUpdate():Boolean
		{
			return _needUpdate;
		}

		public function set needUpdate(value:Boolean):void
		{
			if(_needUpdate && !value)
			{
				UpdateList.instance.remove(this);
			}
			_needUpdate = value;
			if(_needUpdate)
			{
				UpdateList.instance.add(this);
			}
		}
		
		public var relateToParent:Boolean = false;
		
		public function get totalHeight():Number
		{
			return top + height + bottom;
		}
		
		public function get totalWidth():Number
		{
			return left + width + right;
		}
		
		public function get maxHeight():Number
		{
			return (measureHeight > height) ? measureHeight : height;
		}
		
		public function get maxWidth():Number
		{
			return (measureWidth > width) ? measureWidth : width;
		}
				
		public function get measureHeight():Number
		{
			return super.height
		}
		
		public function get measureWidth():Number
		{
			return super.width;
		}
		
		private var _isSizeChange:Boolean = true;

		public function get isSizeChange():Boolean
		{
			return _isSizeChange;
		}

		public function set isSizeChange(value:Boolean):void
		{
			if(isAlignChange || isValignChange)
			{
				_isSizeChange = true;
			}
			else
			{
				_isSizeChange = value;
			}
		}
		
		private var _height:Number = 0;
		
		override public function get height():Number
		{
			if(relateToParent && this.parent)
			{
				return this.parent.height;
			}
			return _height;
		}
		
		override public function set height(value:Number):void
		{
			_height = value;
			
			isSizeChange = true;
			needUpdate = true;
		}
		
		private var _width:Number = 0;
		
		override public function get width():Number
		{
			if(relateToParent && this.parent)
			{
				return this.parent.width;
			}
			return _width;
		}
		
		override public function set width(value:Number):void
		{
			_width = value;
			
			isSizeChange = true;
			needUpdate = true;
		}
		
		public var percentHeight:Number = NaN;
		public var percentWidth:Number = NaN;
		
		public var isAlignChange:Boolean = false;
		private var _align:String = null;

		public function get align():String
		{
			return _align;
		}

		public function set align(value:String):void
		{
			_align = value;
			
			if(value)
			{
				isAlignChange = true;
				if(parent)
				{
					needUpdate = true;
				}
			}
		}
		
		public var isValignChange:Boolean = false;
		private var _valign:String = null;

		public function get valign():String
		{
			return _valign;
		}

		public function set valign(value:String):void
		{
			_valign = value;
			
			if(value)
			{
				isValignChange = true;
				if(parent)
				{
					needUpdate = true;
				}
			}
		}
		
		private var _left:Number = 0;
		
		public function get left():Number
		{
			return _left;
		}
		
		public function set left(value:Number):void
		{
			super.x = super.x - left;
			_left = value;
			super.x = super.x + left;
		}
		
		private var _right:Number = 0;
		
		public function get right():Number
		{
			return _right;
		}
		
		public function set right(value:Number):void
		{
			super.x = super.x - right;
			_right = value;
			super.x = super.x + right;
		}
		
		private var _top:Number = 0;
		
		public function get top():Number
		{
			return _top;
		}
		
		public function set top(value:Number):void
		{
			super.y = super.y - top;
			_top = value;
			super.y = super.y + top;
		}
		
		private var _bottom:Number = 0;
		
		public function get bottom():Number
		{
			return _bottom;
		}
		
		public function set bottom(value:Number):void
		{
			super.y = super.y - bottom;
			_bottom = value;
			super.y = super.y + bottom;
		}
		
		override public function set x(value:Number):void
		{
			super.x = value + left;
		}
		
		override public function set y(value:Number):void
		{
			super.y = value + top;
		}
		
		public function get outerX():Number
		{
			return x - left;
		}
		
		public function set outerX(value:Number):void
		{
			super.x = value;
		}
		
		public function get outerY():Number
		{
			return y - top;
		}
		
		public function set outerY(value:Number):void
		{
			super.y = value;
		}

		public function get centerX():Number
		{
			return width / 2;
		}

		public function get middleY():Number
		{
			return height / 2;
		}
		
		private var _isPaddingChange:Boolean = false;

		public function get isPaddingChange():Boolean
		{
			return _isPaddingChange;
		}

		public function set isPaddingChange(value:Boolean):void
		{
			_isPaddingChange = value;
			
			if(value)
			{
				needUpdate = true;
			}
		}

		private var _padding:Number = NaN;

		public function get padding():Number
		{
			return _padding;
		}

		public function set padding(value:Number):void
		{
			if(_padding == value)
			{
				return;
			}
			_padding = value;
			
			if(isNaN(value))
			{
				return;
			}
			_paddingLeft = value;
			_paddingRight = value;
			_paddingTop = value;
			_paddingBottom = value;
		}

		private var _paddingLeft:Number = 0;

		public function get paddingLeft():Number
		{
			return _paddingLeft;
		}

		public function set paddingLeft(value:Number):void
		{
			if(_paddingLeft == value)
			{
				return;
			}
			_paddingLeft = value;
			_padding = NaN;
			isPaddingChange = true;
		}

		private var _paddingRight:Number = 0;

		public function get paddingRight():Number
		{
			return _paddingRight;
		}

		public function set paddingRight(value:Number):void
		{
			if(_paddingRight == value)
			{
				return;
			}
			_paddingRight = value;
			_padding = NaN;
			isPaddingChange = true;
		}

		private var _paddingTop:Number = 0;

		public function get paddingTop():Number
		{
			return _paddingTop;
		}

		public function set paddingTop(value:Number):void
		{
			if(_paddingTop == value)
			{
				return;
			}
			_paddingTop = value;
			_padding = NaN;
			isPaddingChange = true;
		}

		private var _paddingBottom:Number = 0;

		public function get paddingBottom():Number
		{
			return _paddingBottom;
		}

		public function set paddingBottom(value:Number):void
		{
			if(_paddingBottom == value)
			{
				return;
			}
			_paddingBottom = value;
			_padding = NaN;
			isPaddingChange = true;
		}
		
		public var backgroundContainer:ChartObject = null;
		
		private var _isBackgroundChange:Boolean = false;

		public function get isBackgroundChange():Boolean
		{
			return _isBackgroundChange;
		}

		public function set isBackgroundChange(value:Boolean):void
		{
			_isBackgroundChange = value;
			
			if(value)
			{
				needRender = true;
			}
		}

		private var _backgroundAlpha:Number = 1;

		public function get backgroundAlpha():Number
		{
			return _backgroundAlpha;
		}

		public function set backgroundAlpha(value:Number):void
		{
			if(value < 0 || value > 1)
			{
				return;
			}
			_backgroundAlpha = value;
			isBackgroundChange = true;
		}

		private var _backgroundColor:Number = NaN;

		public function get backgroundColor():Number
		{
			return _backgroundColor;
		}

		public function set backgroundColor(value:Number):void
		{
			if(value < 0)
			{
				return;
			}
			_backgroundColor = value;
			isBackgroundChange = true;
		}
		
		private var _backgroundCornerRadius:Object = null;

		public function get backgroundCornerRadius():Object
		{
			return _backgroundCornerRadius;
		}

		public function set backgroundCornerRadius(value:Object):void
		{
			_backgroundCornerRadius = value;
			isBackgroundChange = true;
		}

		public var background:Background = null;
		
		private var _backgroundImage:Object = null;

		public function get backgroundImage():Object
		{
			return _backgroundImage;
		}

		public function set backgroundImage(value:Object):void
		{
			_backgroundImage = value;
			isBackgroundChange = true;
		}

		private var _color:Number = NaN;

		public function get color():Number
		{
			return _color;
		}

		public function set color(value:Number):void
		{
			if(value < 0)
			{
				return;
			}
			_color = value;
		}
		
		private var _isBorderChange:Boolean = false;

		public function get isBorderChange():Boolean
		{
			return _isBorderChange;
		}

		public function set isBorderChange(value:Boolean):void
		{
			_isBorderChange = value;
			if(value)
			{
				needRender = true;
			}
		}
		
		private var _borderAlpha:Number = NaN;
		
		public function get borderAlpha():Number
		{
			return _borderAlpha;
		}
		
		public function set borderAlpha(value:Number):void
		{
			_borderAlpha = value;
			isBorderChange = true;
		}

		private var _borderColor:Number = NaN;

		public function get borderColor():Number
		{
			return _borderColor;
		}

		public function set borderColor(value:Number):void
		{
			_borderColor = value;
			isBorderChange = true;
		}

		private var _borderThickness:Number = 1;

		public function get borderThickness():Number
		{
			return _borderThickness;
		}

		public function set borderThickness(value:Number):void
		{
			_borderThickness = value;
			isBorderChange = true;
		}
		
		private var _isBlurChange:Boolean = false;

		public function get isBlurChange():Boolean
		{
			return _isBlurChange;
		}

		public function set isBlurChange(value:Boolean):void
		{
			_isBlurChange = value;
			if(value)
			{
				needRender = true;
			}
		}

		private var _blurX:Number = 0;

		public function get blurX():Number
		{
			return _blurX;
		}

		public function set blurX(value:Number):void
		{
			_blurX = value;
			isBlurChange = true;
		}

		private var _blurY:Number = 0;

		public function get blurY():Number
		{
			return _blurY;
		}

		public function set blurY(value:Number):void
		{
			_blurY = value;
			isBlurChange = true;
		}

		private var _blurQuality:int = 1;

		public function get blurQuality():int
		{
			return _blurQuality;
		}

		public function set blurQuality(value:int):void
		{
			_blurQuality = value;
			isBlurChange = true;
		}
		
		private var _isGlowChange:Boolean = false;

		public function get isGlowChange():Boolean
		{
			return _isGlowChange;
		}

		public function set isGlowChange(value:Boolean):void
		{
			_isGlowChange = value;
			if(value)
			{
				needRender = true;
			}
		}

		private var _glowAlpha:Number = 1;

		public function get glowAlpha():Number
		{
			return _glowAlpha;
		}

		public function set glowAlpha(value:Number):void
		{
			_glowAlpha = value;
			isGlowChange = true;
		}

		private var _glowX:Number = 0;

		public function get glowX():Number
		{
			return _glowX;
		}

		public function set glowX(value:Number):void
		{
			_glowX = value;
			isGlowChange = true;
		}

		private var _glowY:Number = 0;

		public function get glowY():Number
		{
			return _glowY;
		}

		public function set glowY(value:Number):void
		{
			_glowY = value;
			isGlowChange = true;
		}

		private var _glowColor:Number = NaN;

		public function get glowColor():Number
		{
			return _glowColor;
		}

		public function set glowColor(value:Number):void
		{
			_glowColor = value;
			isGlowChange = true;
		}

		private var _glowStrength:int = 2;

		public function get glowStrength():int
		{
			return _glowStrength;
		}

		public function set glowStrength(value:int):void
		{
			_glowStrength = value;
			isGlowChange = true;
		}

		private var _innerGlow:Boolean = false;

		public function get innerGlow():Boolean
		{
			return _innerGlow;
		}

		public function set innerGlow(value:Boolean):void
		{
			_innerGlow = value;
			isGlowChange = true;
		}

		private var _glowKnockout:Boolean = false;

		public function get glowKnockout():Boolean
		{
			return _glowKnockout;
		}

		public function set glowKnockout(value:Boolean):void
		{
			_glowKnockout = value;
			isGlowChange = true;
		}

		private var _glowQuality:int = 1;

		public function get glowQuality():int
		{
			return _glowQuality;
		}

		public function set glowQuality(value:int):void
		{
			_glowQuality = value;
			isGlowChange = true;
		}
		
		private var _isShadowChange:Boolean = false;

		public function get isShadowChange():Boolean
		{
			return _isShadowChange;
		}

		public function set isShadowChange(value:Boolean):void
		{
			_isShadowChange = value;
			if(value)
			{
				needRender = true;
			}
		}

		private var _shadowAlpha:Number = 1;

		public function get shadowAlpha():Number
		{
			return _shadowAlpha;
		}

		public function set shadowAlpha(value:Number):void
		{
			_shadowAlpha = value;
			isShadowChange = true;
		}

		private var _shadowAngle:Number = 45;

		public function get shadowAngle():Number
		{
			return _shadowAngle;
		}

		public function set shadowAngle(value:Number):void
		{
			_shadowAngle = value;
			isShadowChange = true;
		}

		private var _shadowX:Number = 0;

		public function get shadowX():Number
		{
			return _shadowX;
		}

		public function set shadowX(value:Number):void
		{
			_shadowX = value;
			isShadowChange = true;
		}

		private var _shadowY:Number = 0;

		public function get shadowY():Number
		{
			return _shadowY;
		}

		public function set shadowY(value:Number):void
		{
			_shadowY = value;
		}

		private var _shadowColor:Number = NaN;

		public function get shadowColor():Number
		{
			return _shadowColor;
		}

		public function set shadowColor(value:Number):void
		{
			_shadowColor = value;
			isShadowChange = true;
		}

		private var _shadowDistance:Number = 4;

		public function get shadowDistance():Number
		{
			return _shadowDistance;
		}

		public function set shadowDistance(value:Number):void
		{
			_shadowDistance = value;
			isShadowChange = true;
		}

		private var _innerShadow:Boolean = false;

		public function get innerShadow():Boolean
		{
			return _innerShadow;
		}

		public function set innerShadow(value:Boolean):void
		{
			_innerShadow = value;
			isShadowChange = true;
		}

		private var _shadowKnockout:Boolean = false;

		public function get shadowKnockout():Boolean
		{
			return _shadowKnockout;
		}

		public function set shadowKnockout(value:Boolean):void
		{
			_shadowKnockout = value;
			isShadowChange = true;
		}

		private var _shadowQuality:int = 1;

		public function get shadowQuality():int
		{
			return _shadowQuality;
		}

		public function set shadowQuality(value:int):void
		{
			_shadowQuality = value;
			isShadowChange = true;
		}

		private var _shadowStrength:Number = 2;

		public function get shadowStrength():Number
		{
			return _shadowStrength;
		}

		public function set shadowStrength(value:Number):void
		{
			_shadowStrength = value;
			isShadowChange = true;
		}

		public var isStyleChange:Boolean = false;
		private var _style:Object = null;
		
		public function get style():Object
		{
			return _style;
		}
		
		public function set style(value:Object):void
		{
			_style = value;
			
			isStyleChange = true;
			needRender = true;
		}
		
		public var serializationValue:Object = {};
		
		private var defaultValue:Object = 
		{
			"data" : null,
			"chart" : null,
			"alpha" : 1,
			"height" : 0,
			"width" : 0,
			"percentHeight" : NaN,
			"percentWidth" : NaN,
			"left" : 0,
			"right" : 0,
			"top" : 0,
			"bottom" : 0,
			"padding" : NaN,
			"paddingLeft" : 0,
			"paddingRight" : 0,
			"paddingTop" : 0,
			"paddingBottom" : 0,
			"backgroundAlpha" : 1,
			"backgroundColor" : NaN,
			"backgroundCornerRadius" : null,
			"borderAlpha" : 1,
			"borderColor" : NaN,
			"borderThickness" : NaN,
			"blurX" : 0,
			"blurY" : 0,
			"blurQuality" : 1,
			"glowAlpha" : 1,
			"glowX" : 0,
			"glowY" : 0,
			"glowColor" : NaN,
			"glowStrength" : 2,
			"innerGlow" : false,
			"glowKnockout" : false,
			"glowQuality" : 1,
			"shadowAlpha" : 1,
			"shadowAngle" : 45,
			"shadowX" : 0,
			"shadowY" : 0,
			"shadowColor" : NaN,
			"shadowDistance" : 4,
			"innerShadow" : false,
			"shadowKnockout" : false,
			"shadowQuality" : 1,
			"shadowStrength" : 2,
			"color" : NaN,
			"align" : null,
			"valign" : null,
			"style" : null
		}
			
		private var _propertiesArray:Array = null;
		
		public function get propertiesArray():Array
		{
			if(_propertiesArray)
			{
				return _propertiesArray;
			}
			
			_propertiesArray = [];
			for(var name:String in defaultValue)
			{
				_propertiesArray.push(name);
			}
			return _propertiesArray;
		}
		
		public function ChartObject()
		{
			super();
			
			this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
			
			this.dataFormat = SerializeFactory.instance.format;
			
			this.serializer = SerializeFactory.instance.create(this.alias);
			if(this.serializer)
			{
				this.serializer.target = this;
			}
			
			this.renderer = RendererFactory.instance.create(this.alias);
			if(this.renderer)
			{
				this.renderer.target = this;
			}
		}
		
		public function init():void
		{
		}
		
		public function getDefaultValue(name:String):*
		{
			return defaultValue[name];
		}
		
		public function getSerializationValue(name:String, defaultValue:*=null):*
		{
			if(serializationValue[name])
			{
				return serializationValue[name];
			}
			else if(defaultValue)
			{
				return defaultValue;
			}
			else
			{
				return getDefaultValue(name);
			}
		}
		
		public function clone():ChartObject
		{
			var object:ChartObject = ChartObjectFactory.instance.create(this.alias) as ChartObject;
			
			for each(var property:String in propertiesArray)
			{
				object[property] = this[property];
			}
			
			return object;
		}
		
		public function cloneData(ignoreArray:Array=null):Object
		{
			if(!data)
			{
				return null;
			}
			var copy:Object = new Object();
			for(var name:String in data)
			{
				if(!ignoreArray || !ArrayUtil.containsValue(ignoreArray, name))
				{
					copy[name] = data[name];
				}
			}
			return copy;
		}
		
		public function clear():void
		{
			filters = [];
			graphics.clear();
			removeAllChildren();
			init();
		}
		
		public function fromData(data:Object):Boolean
		{
			if(this.serializer)
			{
				needRender = true;
				return this.serializer.fromData(data);
			}
			return false;
		}
		
		public function toData():Object
		{
			if(!this.serializer)
			{
				this.serializer = SerializeFactory.instance.create(this.alias);
			}
			if(!this.serializer)
			{
				return null;
			}
			return this.serializer.toData();
		}
		
		public function destory():void
		{
			if(needUpdate)
			{
				needUpdate = false;
			}
			for(var index:int = 0; index < numChildren; index++)
			{
				var child:DisplayObject = getChildAt(index);
				if(child is IChartObject)
				{
					(child as IChartObject).destory();
				}
			}
			removeAllChildren();
		}
		
		public function removeChildByAlias(alias:String):void
		{
			removeChildByClassName(ChartObjectFactory.getClassNameByAlis(alias));
		}
		
		public function removeChildByClassName(className:String):void
		{
			if(StringUtil.isBlank(className))
			{
				return;
			}
			var removeArray:Array = [];
			for(var index:int = 0; index < numChildren; index++)
			{
				var child:DisplayObject = getChildAt(index);
				if(child.hasOwnProperty("className") && child["className"] == className)
				{
					removeArray.push(child);
				}
			}
			for each(var remove:DisplayObject in removeArray)
			{
				if(remove is ChartObject)
				{
					(remove as ChartObject).destory();
				}
				removeChild(remove);
			}
		}
		
		public function removeAllChildren():void
		{
			while(numChildren > 0)
			{
				var child:DisplayObject = getChildAt(0);
				if(child is ChartObject)
				{
					(child as ChartObject).destory();
				}
				removeChild(child);
			}
		}
		
		public function render():Boolean
		{
			if(renderer)
			{
				renderComplete = renderer.render();
				return renderComplete;
			}
			return false;
		}
		
		public function update(callAfterUpdate:Boolean=true):Boolean
		{
			if(needUpdate)
			{
				needUpdate = false;
			}
			if(needRender)
			{
				needRender = false;
				render();
			}
			if(isSizeChange)
			{
				updateSize();
			}
			if(isStyleChange)
			{
				updateStyle();
			}
			if(isBorderChange)
			{
				isBorderChange = false;
			}
			if(isBlurChange)
			{
				isBlurChange = false;
			}
			if(isGlowChange)
			{
				isGlowChange = false;
			}
			if(isShadowChange)
			{
				isShadowChange = false;
			}
			if(isBackgroundChange)
			{
				isBackgroundChange = false;
				if(background)
				{
					if(!backgroundContainer)
					{
						backgroundContainer = new ChartObject();
						backgroundContainer.relateToParent = true;
						addChildAt(backgroundContainer, 0);
					}
					backgroundContainer.removeAllChildren();
					backgroundContainer.addChild(background);
				}
				else
				{
					if(backgroundContainer)
					{
						backgroundContainer.clear();
					}
				}
			}
			return true;
		}
		
		public function afterUpdate():Boolean
		{
			for each(var object:ChartObject in notifyUpdateArray)
			{
				object.update();
			}
			notifyUpdateArray = [];
			return true;
		}
		
		protected function onAddedToStage(event:Event):void
		{
			if(isAlignChange || isValignChange)
			{
				needUpdate = true;
			}
		}
		
		public function updateSize():void
		{
			if(!parent)
			{
				return;
			}
			if(isAlignChange && parent)
			{
				isAlignChange = false;
				switch(align)
				{
					case LEFT:
						x = 0;
						break;
					case CENTER:
						x = (parent.width / 2) - left - (maxWidth / 2);
						break;
					case RIGHT:
						x = parent.width - left - maxWidth - right;
						break;
					default:
						x = 0;
				}
			}
			if(isValignChange && parent)
			{
				isValignChange = false;
				switch(valign)
				{
					case TOP:
						y = 0;
						break;
					case MIDDLE:
						y = (parent.height / 2) - top - (maxHeight / 2);
						break;
					case BOTTOM:
						y = parent.height - top - maxHeight - bottom;
						break;
					default:
						y = 0;
				}
			}
			for(var i:int = 0; i < numChildren; i++)
			{
				if(getChildAt(i) is IChartObject)
				{
					var child:ChartObject = getChildAt(i) as ChartObject;
					child.isAlignChange = true;
					child.isValignChange = true;
					child.updateSize();
				}
			}
		}
		
		public function updateStyle():void
		{
			isStyleChange = false;
		}
		
		private var notifyUpdateArray:Array = [];
		public function notifyUpdate(object:ChartObject):void
		{
			if(!ArrayUtil.containsValue(notifyUpdateArray, object))
			{
				notifyUpdateArray.push(object);
			}
		}
	}
}